﻿using Common.MQ;
using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Kafka
{
    /// <summary>
    /// kafka提供者
    /// </summary>
    public class KafkaProvider : IMessageQueueProvider
    {
        private readonly KafkaBuilder builder;
        /// <summary>
        /// kafka提供者
        /// </summary>
        /// <param name="builder"></param>
        public KafkaProvider(KafkaBuilder builder)
        {
            this.builder = builder;
        }
        /// <summary>
        /// 生产者
        /// </summary>
        public IMQProducer Producer => builder.Producer;
        /// <summary>
        /// 消费者
        /// </summary>
        public List<MQConsumerBase> Consumers => builder.Consumers;
        /// <summary>
        /// 消息队列类型
        /// </summary>
        public MessageQueueType QueueType => MessageQueueType.Kafka;
    }
}
